// 定义中文数字到阿拉伯数字的映射
const chineseNumbers = {
    "零": 0,
    "一": 1,
    "二": 2,
    "三": 3,
    "四": 4,
    "五": 5,
    "六": 6,
    "七": 7,
    "八": 8,
    "九": 9
};

// 处理车牌号的函数
export function formatLicensePlate(plateText) {
    // 去除不必要的标点符号
    let cleanText = plateText.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '');
    // 省份简称转大写
    let province = cleanText[0].toUpperCase();
    // 字母转大写
    let letter = cleanText[1].toUpperCase();
    // 处理中文数字
    let numbers = '';
    for (let i = 2; i < cleanText.length; i++) {
        if (chineseNumbers[cleanText[i]]!== undefined) {
            numbers += chineseNumbers[cleanText[i]];
        } else {
            numbers += cleanText[i];
        }
    }
    return province + letter + numbers;
}
    